//#define  _CRT_SECURE_NO_WARNINGS
//#include <iostream>
//using namespace std;
//
//void func(long long& a, long long& b, long long& c, long long k)
//{
//	long long prev_a = 0;
//	long long prev_b = 0;
//	long long prev_c = 0;
//	long long _a = 0;
//	long long _b = 0;
//	long long _c = 0;
//	while (k--)
//	{
//		prev_a = a;
//		prev_b = b;
//		prev_c = c;
//		_a = (b + c) / 2;
//		_b = (a + c) / 2;
//		_c = (a + b) / 2;
//		a = _a;
//		b = _b;
//		c = _c;
//		if (prev_a == a && prev_b == b && prev_c == c)
//			break;
//	}
//}
//int main()
//{
//	int T = 0;
//	cin >> T;
//	while (T--)
//	{
//		long long a, b, c, k;
//		cin >> a >> b >> c >> k;
//		func(a, b, c, k);
//		cout << a << " " << b << " " << c << endl;
//	}
//	return 0;
//}
///*
//1
//10 20 30 1
//*/
//
////void func(long long& a, long long& b, long long& c, long long k)
////{
////	while (k--)
////	{
////		int _a = (b + c) / 2;
////		int _b = (a + c) / 2;
////		int _c = (a + b) / 2;
////		a = _a;
////		b = _b;
////		c = _c;
////	}
////}
////int main()
////{
////	int T = 0;
////	cin >> T;
////	while (T--)
////	{
////		long long a, b, c, k;
////		cin >> a >> b >> c >> k;
////		for (long long i = 1; i <= k; i++)
////		{
////			func(a, b, c, i);
////			cout << a << " " << b << " " << c << endl;
////		}
////	}
////	return 0;
////}
///*
//1
//10 20 154150 10
//*/
////
////
////void func(long long& a, long long& b, long long& c, long long k)
////{
////	long long prev_a = a;
////	long long prev_b = b;
////	long long prev_c = c;
////	long long _a = (b + c) / 2;
////	long long _b = (a + c) / 2;
////	long long _c = (a + b) / 2;
////	while (k--)
////	{
////		prev_a = a;
////		prev_b = b;
////		prev_c = c;
////		_a = (b + c) / 2;
////		_b = (a + c) / 2;
////		_c = (a + b) / 2;
////		a = _a;
////		b = _b;
////		c = _c;
////		if (prev_a == a && prev_b == b && prev_c == c)
////			break;
////	}
////}
////int main()
////{
////	int T = 100;
////	while (T--)
////	{
////		long long a = 1, b = 20000, c = 1000000000, k = 1000000000;
////		func(a, b, c, k);
////		cout << a << " " << b << " " << c << endl;
////	}
////	return 0;
////}